import{createRouter,createWebHistory}from 'vue-router'

import LoginVue from '@/views/LoginVue.vue';
import LayoutVue from '@/views/LayoutVue.vue';
import testVue from '@/views/test.vue';
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue';
import ProductManageVue from '@/views/catalogManage/ProductManage.vue';
import CategoryManageVue from '@/views/catalogManage/CategoryManage.vue';
import ItemManageVue from '@/views/catalogManage/ItemManage.vue';
import OrderManageVue from '@/views/otherManage/OrderManage.vue';
import AdminManageVue from '@/views/otherManage/AdminManage.vue';
import UserManageVue from '@/views/otherManage/UserManage.vue';

const routes = [
    {path:'/test', component: testVue},
    {path:'/login', component: LoginVue},
    {
        path:'/', 
        component: LayoutVue,
        redirect: 'manage/admin',
        children:[
            {path:'/admin/resetpassword' ,component:UserResetPasswordVue},
            {path:'/manage/category'     ,component:CategoryManageVue},
            {path:'/manage/product'     ,component:ProductManageVue},
            {path:'/manage/item'     ,component:ItemManageVue},
            {path:'/manage/order'     ,component:OrderManageVue},
            {path:'/manage/admin'     ,component:AdminManageVue},
            {path:'/manage/user'     ,component:UserManageVue}
        ]
    },
]

const router = createRouter({
    history : createWebHistory(),
    routes : routes
});

export default router;